package com.fyzk.adapter;

import java.util.List;

import android.support.v4.view.PagerAdapter;
import android.support.v4.view.ViewPager;
import android.view.View;

import com.fyzk.activity.user.ZhangHuMXRecordView;

/**
 * pagerAdapter
 * 
 * @author Administrator
 * 
 */
public class ZhangHuMXPagerAdP extends PagerAdapter {
	
	List<ZhangHuMXRecordView> vp_views ;
	
	public ZhangHuMXPagerAdP(List<ZhangHuMXRecordView> vp_views ){
		this.vp_views = vp_views;
	}

	@Override
	public int getCount() {
		// TODO Auto-generated method stub
		return this.vp_views.size();
	}

	@Override
	public boolean isViewFromObject(View arg0, Object arg1) {
		// TODO Auto-generated method stub
		return arg0 == (arg1);
	}
	
	@Override
	public Object instantiateItem(View arg0, int arg1) {
		((ViewPager) arg0).addView(vp_views.get(arg1), 0);
		return vp_views.get(arg1);
	}
	@Override
	public void destroyItem(View arg0, int arg1, Object arg2) {
		((ViewPager) arg0).removeView(vp_views.get(arg1));
	}
}
